<template>
  <a-spin :spinning="getuserInfoLoding">
    <div class="VPFlyout VPNavBarMenuGroup" style="line-height: 64px;">
      <a-button type="link" @click="userStore.setOpenLoginModal(true)" v-if="!loginStatus">登录</a-button>
      <a-space v-else>
        <div class="text-sm">欢迎用户:{{ userInfo.email }}
        </div>
        <a-button type="link" @click="userStore.logout" class="p-0 m-0" danger>退出登录</a-button>
      </a-space>
    </div>
  </a-spin>

</template>
<script setup>
import { computed } from 'vue'
import { useUserStore } from '../../../stores/user'
const userStore = useUserStore()
const userInfo = computed(() => userStore.userInfo)
const loginStatus = computed(() => userStore.loginStatus)
const getuserInfoLoding = computed(() => userStore.getuserInfoLoding)
</script>